package com.atguigu.stgy.app.controller;

//import com.atguigu.stgy.admin.service.LeaseTermService;
import com.atguigu.stgy.app.service.LeaseTermService;
import com.atguigu.stgy.model.entity.LeaseTerm;
import com.atguigu.stgy.model.result.R;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

//

/**
 * 租期(lease_term)表控制层
 *
 * @author xxxxx
 */
@RestController
@Tag(name = "租期管理模块")
@RequestMapping("/app/term")
public class LeaseTermController {
    /**
     * 服务对象
     */
    @Resource
    private LeaseTermService leaseTermService;

    @Operation(summary = "查询room的租期列表")
    @GetMapping("/listByRoomId")
    public R<List<LeaseTerm>> listByRoomId(@RequestParam("id")Long roomId){

        return R.ok(leaseTermService.selectListByRoomId(roomId));
    }

}
